package cn.blog.code.user.Control;

import cn.blog.code.user.domain.UserInfo;
import cn.blog.code.user.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/user")
@RestController
public class UserInfoControl {
    private final UserInfoService userInfoService;

    public UserInfoControl(UserInfoService userInfoService) {
        this.userInfoService = userInfoService;
    }

    @GetMapping("/getUser")
    public List<UserInfo> getAll(){
        return userInfoService.list();
    }
}
